#include "gotolist.h"
#include <QKeyEvent>
#include <QListWidget>
#include <gotocontrol.h>


GoToList::GoToList(QWidget *parent) :
    QListWidget(parent)
{
    m_parentControl = NULL;
}


void GoToList::keyPressEvent(QKeyEvent *e)
{
    int key = e->key();
    if(key != Qt::Key_Up && key != Qt::Key_Down && key != Qt::Key_PageUp
        && key != Qt::Key_PageDown)
    {
        if(m_parentControl)
            m_parentControl->keyPressEvent(e);
        e->accept();
        return;
    }
    QListWidget::keyPressEvent(e);
}

void GoToList::setParentControl(GoToControl *aControl)
{
    m_parentControl = aControl;
}
